.cart-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cart-item {
    display: grid;
    grid-template-columns: 40px 120px 2fr 1fr 1fr 80px;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.cart-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-info h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.price {
    color: #e74c3c;
    font-weight: bold;
    margin: 0;
}

.quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background-color: #f8f8f8;
}

.quantity-value {
    min-width: 40px;
    text-align: center;
    font-size: 16px;
}

.subtotal {
    font-weight: bold;
    color: #e74c3c;
    font-size: 16px;
}

.remove-btn {
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-btn:hover {
    background-color: #e74c3c;
    color: #fff;
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 20px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 8px;
}

.total {
    font-size: 18px;
    font-weight: bold;
}

#cart-total {
    color: #e74c3c;
    margin-left: 8px;
}

.checkout-btn {
    padding: 12px 30px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.checkout-btn:hover {
    background-color: #c0392b;
}

.empty-cart {
    text-align: center;
    padding: 40px;
}

.empty-cart p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.continue-shopping {
    display: inline-block;
    padding: 12px 30px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.continue-shopping:hover {
    background-color: #2980b9;
}

/* 复选框样式 */
.item-checkbox, #select-all {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 30px 100px 1fr;
        gap: 10px;
    }

    .cart-item img {
        width: 100px;
        height: 100px;
    }

    .quantity, .subtotal, .remove-btn {
        grid-column: 2 / -1;
        justify-content: flex-end;
    }
}

/* 确保模态框样式在两个页面都能正常工作 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

.order-summary {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.selected-items {
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
}

.selected-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.selected-item:last-child {
    border-bottom: none;
}

.shipping-info {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.submit-order {
    width: 100%;
    padding: 12px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.submit-order:hover {
    background-color: #c0392b;
}

/* 商品卡片中的立即购买按钮样式 */
.buy-now-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 10px;
}

.buy-now-btn:hover {
    background-color: #c0392b;
}
